# 创建列表
List = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
print("Initial List: ")
print(List)

# 使用 remove() 方法删除指定元素
List.remove(5)
List.remove(6)
print("\nList after Removal of two elements: ")
print(List)

# 使用迭代器删除一定范围元素
for i in range(1, 5):
    List.remove(i)
print("\nList after Removing a range of elements: ")
print(List)


List = [1,2,3,4,5]

# 从列表中删除元素,使用pop()函数
List.pop()
print("\nList after popping an element: ")
print(List)

# 从特定位置移除元素,使用pop()函数
List.pop(2)
print("\nList after popping a specific element: ")
print(List)

